/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ChArFaTo
 */
@Entity
@Table(name = "salario", catalog = "proyectosw", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SalarioEJB.findAll", query = "SELECT s FROM SalarioEJB s"),
    @NamedQuery(name = "SalarioEJB.findBySCodigo", query = "SELECT s FROM SalarioEJB s WHERE s.sCodigo = :sCodigo"),
    @NamedQuery(name = "SalarioEJB.findBySValorBase", query = "SELECT s FROM SalarioEJB s WHERE s.sValorBase = :sValorBase"),
    @NamedQuery(name = "SalarioEJB.findBySPrestaciones", query = "SELECT s FROM SalarioEJB s WHERE s.sPrestaciones = :sPrestaciones"),
    @NamedQuery(name = "SalarioEJB.findBySSalud", query = "SELECT s FROM SalarioEJB s WHERE s.sSalud = :sSalud"),
    @NamedQuery(name = "SalarioEJB.findBySPension", query = "SELECT s FROM SalarioEJB s WHERE s.sPension = :sPension"),
    @NamedQuery(name = "SalarioEJB.findBySTotal", query = "SELECT s FROM SalarioEJB s WHERE s.sTotal = :sTotal")})
public class SalarioEJB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer sCodigo;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private double sValorBase;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private double sPrestaciones;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private double sSalud;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private double sPension;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private double sTotal;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "salarioEJB")
    private Collection<SalarioSparafiscalesEJB> salarioSparafiscalesEJBCollection;
    @JoinColumn(name = "Jefe de ProgramaJCodigo", referencedColumnName = "JCodigo")
    @ManyToOne
    private JefeDeProgramaEJB jefedeProgramaJCodigo;
    @JoinColumn(name = "DocenteDTarjetaProfesional", referencedColumnName = "DTarjetaProfesional")
    @ManyToOne
    private DocenteEJB docenteDTarjetaProfesional;

    public SalarioEJB() {
    }

    public SalarioEJB(Integer sCodigo) {
        this.sCodigo = sCodigo;
    }

    public SalarioEJB(Integer sCodigo, double sValorBase, double sPrestaciones, double sSalud, double sPension, double sTotal) {
        this.sCodigo = sCodigo;
        this.sValorBase = sValorBase;
        this.sPrestaciones = sPrestaciones;
        this.sSalud = sSalud;
        this.sPension = sPension;
        this.sTotal = sTotal;
    }

    public Integer getSCodigo() {
        return sCodigo;
    }

    public void setSCodigo(Integer sCodigo) {
        this.sCodigo = sCodigo;
    }

    public double getSValorBase() {
        return sValorBase;
    }

    public void setSValorBase(double sValorBase) {
        this.sValorBase = sValorBase;
    }

    public double getSPrestaciones() {
        return sPrestaciones;
    }

    public void setSPrestaciones(double sPrestaciones) {
        this.sPrestaciones = sPrestaciones;
    }

    public double getSSalud() {
        return sSalud;
    }

    public void setSSalud(double sSalud) {
        this.sSalud = sSalud;
    }

    public double getSPension() {
        return sPension;
    }

    public void setSPension(double sPension) {
        this.sPension = sPension;
    }

    public double getSTotal() {
        return sTotal;
    }

    public void setSTotal(double sTotal) {
        this.sTotal = sTotal;
    }

    @XmlTransient
    public Collection<SalarioSparafiscalesEJB> getSalarioSparafiscalesEJBCollection() {
        return salarioSparafiscalesEJBCollection;
    }

    public void setSalarioSparafiscalesEJBCollection(Collection<SalarioSparafiscalesEJB> salarioSparafiscalesEJBCollection) {
        this.salarioSparafiscalesEJBCollection = salarioSparafiscalesEJBCollection;
    }

    public JefeDeProgramaEJB getJefedeProgramaJCodigo() {
        return jefedeProgramaJCodigo;
    }

    public void setJefedeProgramaJCodigo(JefeDeProgramaEJB jefedeProgramaJCodigo) {
        this.jefedeProgramaJCodigo = jefedeProgramaJCodigo;
    }

    public DocenteEJB getDocenteDTarjetaProfesional() {
        return docenteDTarjetaProfesional;
    }

    public void setDocenteDTarjetaProfesional(DocenteEJB docenteDTarjetaProfesional) {
        this.docenteDTarjetaProfesional = docenteDTarjetaProfesional;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sCodigo != null ? sCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SalarioEJB)) {
            return false;
        }
        SalarioEJB other = (SalarioEJB) object;
        if ((this.sCodigo == null && other.sCodigo != null) || (this.sCodigo != null && !this.sCodigo.equals(other.sCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelo.SalarioEJB[ sCodigo=" + sCodigo + " ]";
    }
    
}
